/**
 * 
 */
package com.dx.mes.common.dao;

import com.dx.common.table.ppt.Ret_box;
import com.dx.common.table.ppt.Ret_prd_info;
import com.dx.mes.common.core.dao.GenericDao;
import com.dx.mes.common.table.rtnBean.BoxInfoBeen;
import com.dx.mes.common.table.rtnBean.SimpleRtnBeen;

import java.util.List;


public interface IRetBoxDao extends GenericDao<Ret_box, String> {
Ret_box setBoxEmpt(Ret_box box);
	
	/**
	 * 判断是否在半成品仓
	 * @param box
	 * @return
	 */
	Boolean isInWipDestShop(Ret_box box);

	/**
	 * 重置箱子信息
	 * 
	 * @param box
	 * @return SimpleRtnBeen{Ret_box}
	 */
	SimpleRtnBeen configBoxInfo(Ret_box box, String flg);

	/**
	 * 检查prd list的slot no是否合法
	 *
	 * @param gRet_prd_infoList
	 * @return SimpleRtnBeen{lRc|msgBuf}
	 */
	SimpleRtnBeen slotCheck(List<Ret_prd_info> gRet_prd_infoList);

	/**
	 * 原箱检查
	 *
	 * @param box
	 * @param prdInfoList
	 * @param chkSlot
	 * @return
	 */
	SimpleRtnBeen chkMtrlBoxAndSlot(Ret_box box, boolean chkSlot);

	/**
	 * 根据sql查询RET_BOX表
	 *
	 * @param sql
	 * @return
	 */
	List<BoxInfoBeen> queryRetBoxInfoBySql(String sql);

	/**
	 * 将单个RET_BOX转换为BoxInfoBeen
	 *
	 * @param ret_box
	 * @return
	 */
	BoxInfoBeen retBox2BoxInfo(Ret_box ret_box);

	/**
	 * 将单个RET_BOX转换为BoxInfoBeen
	 *
	 * @param ret_box
	 * @return
	 */
	List<BoxInfoBeen> retBox2BoxInfoByManyCondition(String box_id,
                                                    String box_stat, String nx_toolg_id_fk, String wo_id,
                                                    String lot_id_fk);

	/**
	 * 将单个RET_BOX转换为BoxInfoBeen
	 *
	 * @param ret_box
	 * @return
	 */
	List<BoxInfoBeen> retBox2BoxInfoByManyConditionWH(String box_id,
                                                      String box_stat, String wo_id, String wo_ids, String dest_shop, String bnk_flg, String cus_id, String bnk_flgs, String so_id);

	/**
	 * 将单个RET_BOX转换为BoxInfoBeen
	 *
	 * @param ret_box
	 * @return
	 */
	List<BoxInfoBeen> retBox2BoxInfoByManyConditionWipWH(String box_id,
                                                         String box_stat, String wo_id, String dest_shop, String bnk_flg, String nx_ope_id);

	/**
	 * 计算箱子良率： 制程良率-box_fst_yield; 综合良率-box_snd_yield
	 * @param box
	 * @return
	 */
	Ret_box setBoxYield(Ret_box box);

	/**
	 * 计算箱子良率： 制程良率-box_fst_yield; 综合良率-box_snd_yield
	 * @param box
	 * @param gRet_prd_infoList 不为null则不用重新查询
	 * @return
	 */
	Ret_box setBoxYield(Ret_box box, List<Ret_prd_info> gRet_prd_infoList);
	List<Ret_box> queryRetBoxBySql(String sql);

	List<BoxInfoBeen> retBox2BoxInfoByManyConditionWHwithFAB(String box_id,
                                                             String box_stat, String wo_id, String wo_ids, String dest_shop,
                                                             String bnk_flg, String cus_id, String so_id);

	List<BoxInfoBeen> retBox2BoxInfoByManyConditionWHwithSHOP(String box_id,
                                                              String box_stat, String wo_id, String wo_ids, String dest_shop,
                                                              String bnk_flg, String cus_id, String so_id);

	List<BoxInfoBeen> retBox2BoxInfoByManyConditionWipWHwithFAB(String box_id,
                                                                String box_stat, String wo_id, String dest_shop, String bankOut,
                                                                String ope_id);

	int getPalletBoxCnt(String palletId);
}
